package avicit.bdp.dds.alert.utils;

import org.apache.commons.lang3.StringUtils;

public class FuncUtils {

    public static String mkString(Iterable<String> list, String split) {

        if (null == list || StringUtils.isEmpty(split)){
            return null;
        }

        StringBuilder sb = new StringBuilder();
        boolean first = true;
        for (String item : list) {
            if (first) {
                first = false;
            } else {
                sb.append(split);
            }
            sb.append(item);
        }
        return sb.toString();
    }

}
